package com.company.thread;

/**
 * @description: 正常非阻塞状态的线程被打断后， 打印 打断状态是 true ,而阻塞状态线程被打断后， 会把true置为false,此时主线程打印出来的就是false了
 * @author: ruoan
 * @date: 2020/10/24 16:02
 */
public class Thread16 {


    public static void main(String[] args) {


        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("进入睡眠");
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }, "T1");
        t.start();
        t.interrupt();
        System.out.println(t.isInterrupted());
        System.out.println("main exit");

    }
}
